package cn.zyn.educms.controller;

import cn.zyn.commonutils.R;
import cn.zyn.educms.entity.CrmBanner;
import cn.zyn.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.Cacheable;

import java.security.Key;
import java.util.List;

/**
 * @author ：zyn
 * @date ：Created in 2022/6/6 15:08
 * @description：前台的前端控制器   显示所有banner
 * @modified By：
 * @version: $
 */
@RestController
@RequestMapping("/educms/bannerfront")
@CrossOrigin
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    //查询所有banner
    @GetMapping("getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}
